<script lang="ts" setup>
import Share from "@/components/Single/Share.vue";
import Image from "@/components/Black/Image.vue";
import { IndexShowData } from "@/api/interface";
interface Props {
  data: IndexShowData;
}

defineProps<Props>();

//图片配置
const configImg = {
  small: "thumbnail", //150
  medium: "thumbnail", //150
  large: "thumbnail", //150
};
</script>
<template>
  <template v-if="data">
    <div class="featured-header">
      <!--图片-->
      <div class="chiclet">
        <Image :data="data.image" :config="configImg"></Image>
      </div>
      <!--分类-->
      <div class="category component">
        <div class="category-eyebrow">
          <span
            class="category-eyebrow__category"
            v-for="key in data.cat"
            :key="key.id"
          >
            {{ key.name }}
          </span>

          <span class="category-eyebrow__date">{{ data.date }}</span>
        </div>
      </div>
      <!--标题-->
      <div class="pagetitle component">
        <div class="component-content">
          <div class="hero-headline">
            {{ data.title }}
          </div>
        </div>
        <!--分享-->
        <div class="sharesheet component">
          <Share :postData="data"></Share>
        </div>
      </div>
    </div>
  </template>
  <template v-else>加载中</template>
</template>
<style lang="less" scoped>
.chiclet {
  margin-left: auto;
  margin-right: auto;
  width: 150px;
  height: 150px;
  border-radius: 32px;
  overflow: hidden;
}
.component {
  width: 100%;
}
.category {
  margin-bottom: 24px;
  margin-top: 44px;
  .category-eyebrow {
    font-size: 14px;
    line-height: 1.28577;
    font-weight: 600;
    letter-spacing: -0.016em;
    font-family: "SF Pro SC", "SF Pro Text", "SF Pro Icons", "PingFang SC",
      "Helvetica Neue", "Helvetica", "Arial", sans-serif;
    margin-top: 0;

    display: flex;
    justify-content: center;
  }
}

.pagetitle {
  .component-content {
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }
  .hero-headline {
    font-size: 48px;
    line-height: 1.08349;
    font-weight: 700;
    letter-spacing: -0.003em;
    font-family: "SF Pro SC", "SF Pro Display", "SF Pro Icons", "PingFang SC",
      "Helvetica Neue", "Helvetica", "Arial", sans-serif;
    text-align: center;
  }
  .sharesheet {
    margin-top: 24px;
    margin-bottom: 44px;
    text-align: center;
  }
}

//分类和时间
.category-eyebrow__category,
.category-eyebrow__date {
  color: #6e6e73;
  margin: 4px 0;
}
.category-eyebrow__date::before {
  color: #6e6e73;
  content: "\2022";
  margin: 0 8px;
}
.category-eyebrow__category {
  display: flex;
  align-items: center;
  text-transform: uppercase;

  margin-right: 1em;
}
.category-eyebrow__date {
  font-size: 14px;
  line-height: 1.28577;
  font-weight: 600;
  letter-spacing: -0.016em;
  font-family: "SF Pro SC", "SF Pro Text", "SF Pro Icons", "PingFang SC",
    "Helvetica Neue", "Helvetica", "Arial", sans-serif;
  display: block;
}
@media only screen and (max-width: 1068px) {
  .chiclet {
    width: 110px;
    height: 110px;
    border-radius: 24px;
  }
  .category {
    margin-bottom: 24px;
    margin-top: 36px;
  }
  .pagetitle {
    .hero-headline {
      font-size: 40px;
      line-height: 1.1;
      font-weight: 700;
    }
    .sharesheet {
      margin-top: 20px;
      margin-bottom: 36px;
    }
  }
}
@media only screen and (max-width: 734px) {
  .chiclet {
    width: 104px;
    height: 104px;
    border-radius: 24px;
  }
  .category {
    margin-bottom: 20px;
    margin-top: 32px;
  }
  .pagetitle {
    .hero-headline {
      font-size: 32px;
      line-height: 1.125;
      font-weight: 700;
    }
    .sharesheet {
      margin-top: 20px;
      margin-bottom: 32px;
    }
  }
}
</style>
